#include <iostream>
#include "lapacke.h"
#include "lapacke_config.h"
#include "lapacke_utils.h"

extern lapack_int LAPACKE_dgeev( int matrix_order, char jobvl, char jobvr,
                          lapack_int n, double* a, lapack_int lda, double* wr,
                          double* wi, double* vl, lapack_int ldvl, double* vr,
                          lapack_int ldvr );

int main(int argc, char* argv[]){
    int matrix_order = LAPACK_COL_MAJOR;
    char jobvl = 'N';
    char jobvr = 'V';
    int n = 50;
    double A[n*n];
    for(int i=1;i<=n*n;i++){
        if((i+n)%(n+1)==0) A[i-1]=(i+n)/(n+1);
        else A[i-1]=0;
    }
    int lda = n;
    double wr[n] = {0};
    double wi[n] = {0};
    double vl[n*n];
    int ldvl = n;
    double vr[n*n];
    int ldvr = n;
    int info = LAPACKE_dgeev(matrix_order,jobvl,jobvr,n,A,lda,wr,wi,vl,ldvl,vr,ldvr);
    if(info==0){
        int i = 0;
        int j = 0;
        for(i=0;i<n;i++){
            std::cout<<"eigenvalue "<<i<<":"<<wr[i]<<"+"<<wi[i]<<"i"<<std::endl;
        }
    }
    return 0;
}